<? include "./configs/session_check.php";?>
<? include "./configs/config.php";

class SelectList
{
 
        public function __construct()
        {
         
        }
 
        public function ShowSection()
        {
            $sql = "SELECT DISTINCT Section FROM Projects";
            $res = mysql_query($sql);
            while($row = mysql_fetch_array($res))
            {
                $category .= '<option value="' . $row['Section'] . '">' . $row['Section'] . '</option>';
            }
            return $category;
        }
 
        public function ShowProject()
		
        {
			$userid=$_SESSION['userid'];
			$section=$_POST['id'];
            $project_query=mysql_query("SELECT * FROM Projects WHERE ProjectManager='$userid' AND Section='$section'");
             $type .= '<option value="Select an option.."> Select an option..</option>';
            while($row = mysql_fetch_array($project_query))
            {
                $type .= '<option value="' . $row['ProjectID'] . '">' . $row['ProjectTitle'] . '</option>';
            }
            return $type;
        }
}
 
$opt = new SelectList();
?>